<!DOCTYPE html>
<html>
  <head>
    <link href="<%= wti_root %>/screen.css" media="screen" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="<%= wti_root %>/favicon.ico" type="image/x-icon" />
    <title>Web Translate It Synchronisation Console</title>
  </head>
  <body>
    <div class="site">
      <div class="title">
        <a href="<%= wti_root %>/">Web Translate It Synchronisation Console</a>
      </div>

      <div id="home">
        <h1>Update</h1>
        
        <div class="update">
          Download files update for 
          <select name="locale" onchange="window.location=this.value;">
            <option value="/" <%= "selected='true'" if locale == "" %>>All locales</option>
            <% config.target_locales.each do |l| %>
              <option value="/<%= l %>" <%= "selected='true'" if locale == l %>><%= l.upcase %></option>
            <% end %>
          </select>
          <form method="post" action="<%= wti_root %>/pull/<%= locale %>">
            <input type="submit" value="Update" onclick="if (window.hiddenCommit) { window.hiddenCommit.setAttribute('value', this.value); }else { hiddenCommit = document.createElement('input');hiddenCommit.type = 'hidden';hiddenCommit.value = this.value;hiddenCommit.name = this.name;this.form.appendChild(hiddenCommit); }this.setAttribute('originalValue', this.value);this.disabled = true;this.value='Please wait...';result = (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit());if (result == false) { this.value = this.getAttribute('originalValue');this.disabled = false; }return result;" />
          </form>
          <div class="clear"></div>
        </div>
                
        <% if config.before_pull %>
        <p>
          This command will be executed before pulling files:
          <code><%= config.before_pull %></code>
        </p>
        <% end %>
        <% if config.after_pull %>
          <p>
            This command will be executed after pulling files:
            <code><%= config.after_pull %></code>
          </p>
        <% end %>
      </div>

      <div class="footer">
        <div class="contact">
          <p>
            <a href="http://docs.webtranslateit.com">Documentation</a><br/>
            <a href="https://github.com/AtelierConvivialite/web_translate_it_server/">Source</a><br/>
            <a href="https://github.com/AtelierConvivialite/web_translate_it_server/issues">Issues</a><br/>
            <a href="http://twitter.com/webtranslateit">Twitter</a>
          </p>
        </div>
        <div class="contact">
          <p>
            wti v.<%= WebTranslateIt::Util.version %><br/>
            Built with <a href="http://sinatrarb.com/">Sinatra</a>
          </p>
        </div>        
      </div>
    </div>
  </body>
</html>